<?php $this->import('Header') ?>
<script type="text/javascript" src="<?php echo \Entity\Domain::instance()->baiduMap ?>"></script>
<div id="body">
    <div class="container-full">
        <div class="in-banner"><img src="/images/por.png"></div>
    </div>
    <div class="container">
        <?php \Controller\UC\Left::instance()->run() ?>
        <div class="in-content">
            <div class="tit">
                <strong class="name">联系我们</strong>
                <span class="desc"></span>
            </div>
            <div class="contact-map-box" style="height:320px;" id="baidu-map"></div>
            <div class="tit">
                <strong class="name">在线留言</strong>
                <span class="desc"></span>
            </div>
            <form id="js-data-form">
            <div class="contact-online-message-box">
                <div>
                    <div class="contact-message-input">
                        <div class="input-text-div"><span class="red-font">*</span>您的姓名:</div>
                        <div class="input-div"><input class="input-text" name="name" /></div>
                    </div>
                    <div class="contact-message-input">
                        <div class="input-text-div"><span class="red-font">*</span>手机号码:</div>
                        <div class="input-div"><input class="input-text" name="phoneNum"/></div>
                    </div>
                    <br class="clear">
                </div>
                <div class="contact-message-input-textarea">
                    <div class="input-text-div"><span class="red-font">*</span>内容:</div>
                    <textarea class="contact-message-textarea" name="content"></textarea>
                </div>
                <center><button class="contact-submit" type="submit" >提交</button></center>
            </div>
            </form>
        </div>
    </div>
</div>
<!--百度地图容器-->
<?php $this->import('Footer') ?>
<script>
    $(function() {
        $('#js-data-form').bind('submit', function() {
            return addMessage(this);
        });
        function addMessage(obj) {
            $(obj).ajaxSubmit({
                url: '/Ajax/Message/addMessage',
                dataType: 'json',
                type: 'post',
                success: function(d) {
                    if (d.error) {
                        alert(d.data)
                    } else {
                        alert('提交成功');
                        window.location.reload();
                    }
                }
            });
            return false;
        }
    });
</script>